import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      // 懒加载写法
      component: () => import('@/views/layout'),
      redirect: '/dashboard',
      children: [
        { path: '/dashboard', component: () => import('@/views/dashboard') },
        { path: '/article', component: () => import('@/views/article') }
      ]
    },
    {
      path: '/login', component: () => import('@/views/login')
    }
  ]
})

export default router
